package com.myway.core.common;
import java.util.HashMap;


public enum AirlineUserStatus {
	/**
	 * 开启
	 */
	OPEN("OPEN"), //启用
	/**
	 * 禁用
	 */
	OFF("OFF"); //禁用
	/**
	 * 别名
	 */
	private final String alias;
	public static final String OPEN_CN="启用";
	public static final String OFF_CN="禁用";
	private static HashMap<String,String> mapcn= new HashMap<String, String>();
	private static HashMap<String, AirlineUserStatus> map = new HashMap<String, AirlineUserStatus>();
	

	static {
		for (AirlineUserStatus e : AirlineUserStatus.values()) {
			map.put(e.alias, e );
		}
		mapcn.put(AirlineUserStatus.OPEN.toString(), OPEN_CN);
		mapcn.put(AirlineUserStatus.OFF.toString(), OFF_CN);
	}
	/**
	 * @param alias alias
	 */
	AirlineUserStatus(String alias) {
		this.alias=alias;
	}
	/**
	 * @return String
	 */
	@Override
	public String toString() {
		return this.alias;

	}
	
	/**
	 * Return a <code>UserStatusConstants</code> object holding the value of specified alias name
	 * @param alias the alias name of the type
	 * @return a <code>AgentTypeEnum</code> object holding the value represented by the alias name argument
	 */
	public static AirlineUserStatus valueOfAlias(String alias) {
		AirlineUserStatus type = map.get(alias);

		if (type == null) {
			throw new IllegalArgumentException("Unknown AirlineUserStatus type enum alias [" + alias + "]");
		}

		return type;
	}
	
	public String getAliasCN(){
		return mapcn.get(this.alias);
	}
}
